#!/usr/bin/env python3
# -*- coding: utf-8 -*-
'just test python3'
__author__="LeeSue"
# -*- coding: utf-8 -*-
# if 10 > 5:
#     print(r'\\')
#     print('''111
# 111
# 333
# ''')
# print("????")
# ss = '二十四桥明月夜'
# print(ss.encode('utf-8'))
# print(len(ss.encode('utf-8')))

# li = [33, 22, 11]
# li.append(44)
# li.insert(1, 'ss')
# print(li[1])
# print(range(10))
# ll = list(range(10))
# ans = 0
# for x in ll:
#     ans += x
# print("ANS is %d" % ans)
# x = 0
# while x >= 0:
#     print(x)
#     x += 1



# a small program to calculate some numbers' square 's sum
# def cal (*num):
#     ans = 0
#     for x in num:
#         ans += x * x
#     return ans

# sum = []
# num = int(input("plese input numbers:"))
# while num != 0:
#     sum.append(num)
#     num = int(input("plese input numbers:"))
# print(cal(*sum))


# # 判断是否可以迭代
# import os
# from collections import Iterable
# ll = [x for x in os.listdir('.')]
# print(isinstance(ll, Iterable))
# # Iterable可以换成其他类型

# # 列出当前目录下的文件
# import os
# ll = [x for x in os.listdir('.')]
# print(ll)

# # 将字符串变小写
# ls = ['HAHA', 'HEHE']
# print([s.lower() for s in ls])


# # 生成素数
# def main():
#     for n in primes():
#         if n < 1e5:
#             pass
#         else:
#             break

# def _odd_iter():
#     n = 1
#     while True:
#         n = n + 2
#         yield n

# def _not_divisible(n):
#     return lambda x: x % n > 0

# def primes():
#     yield 2
#     it = _odd_iter()
#     while True:
#         n = next(it)
#         yield n
#         it = filter(_not_divisible(n), it)

# if __name__ == '__main__':
#     main()

# # 排序
# def ch(name):
#     return name[0]
# L = [('Bob', 75), ('Adam', 92), ('Bart', 66), ('Lisa', 88)]
# print(sorted(L, key=ch))

# # 返回匿名函数
# def createFuns():
#     fs = []
#     def f(i):
#         def g():
#             return i * i
#         return g
#     for i in range(1, 11):
#         fs.append(f(i))
#     return fs

# ll = createFuns()
# for x in ll:
#     print(x())

# # 修饰函数
# import functools

# def log(text):
#     def decor(fun):
#         @functools.wraps(fun)
#         def wrap(*args, **kw):
#             print("%s %s" % (text, fun.__name__))
#             return fun(*args, **kw)
#         return wrap
#     return decor

# @log("start")
# def now():
#     print("run now over")

# now()

# # 偏函数
# import functools
# int2 = functools.partial(int, base=2)
# print(int2('10', base=3))

# # 调用第三方库生成压缩图片
# from PIL import Image
# if(__name__=="__main__"):
#     im = Image.open("4.JPG")
#     print(im.format, im.size, im.mode)
#     im.thumbnail((200,10000))
#     im.save("4s.jpg", "jpeg")

# # 类以及继承
# class Student(object):
#     def __init__(self, name, score):
#         self.__name = name
#         self.__score=score
#     def getName(self):
#         return self.__name
#     def getScore(self):
#         return self.__score
#     def setName(self, name):
#         self.__name = name
#     def setScore(self, score):
#         self.__score = score

# class Dog(Student):
#     def getName(self):
#         print("this dog's name is "+self.__name)

# s1 = Dog("ls", 100)
# print(s1.getName())
# print(s1.getScore())

# # 使用@property
# from types import MethodType
# class Student(object):
#     # __slots__=("name","age")
#     # @property
#     # def setAge(self, age):
#     #     self.age = age
#     _age = 33
#     # def Student(self, val):
#     #     self._age = val

#     @property
#     def age(self):
#         return self._age

#     # @age.setter
#     # def age(self, val):
#     #     self._age = val

# s = Student()
# # s.age = 24
# print(s.age)

# 使用enum定义常量
# from enum import Enum, unique

# @unique
# class Month(Enum):
#     Sun = 0 # Sun的value被设定为0
#     Mon = 1
#     Tue = 2
#     Wed = 3
#     Thu = 4
#     Fri = 5
#     Sat = 6
# for name, member in Month.__members__.items():
#     print(name, '=>', member, ',', member.value)

# class ListMetaclass(type):
#     def __new__(cls, name, bases, attrs):
#         attrs['add'] = lambda self, value: self.append(value)
#         return type.__new__(cls, name, bases, attrs)
# class MyList(list, metaclass=ListMetaclass):
#     pass
# L = MyList()
# L.add(1)
# print(L)

# # try except finally 结构
# def get(s):
#     try:
#         return 1/s
#     except ZeroDivisionError as e:
#         print('division of 0')
#         raise ZeroDivisionError('has a 0')

# try:
#     print(get(1))
# except ZeroDivisionError as e:
#     pass
# finally:
#     print("end")

import logging
import pdb
logging.basicConfig(level=logging.DEBUG)

n = 22
s = 10
pdb.set_trace()
logging.debug(str(n))
p = s / n
print(p)
